package com.SmartCare.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.SmartCare.common.Result;
import com.SmartCare.pojo.Image;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * 图片文件 服务类
 */
public interface ImageService extends IService<Image> {

    /**
     * 新增图片
     *
     * @param files           从前端传过来的MultipartFile文件
     * @param fileUploadPath 文件上传位置
     * @param fileDownloadPath 下载接口访问前缀（当前Controller的RequestMapping），比如在DetailsController中调用前缀则为 "details"
     * @return 返回图片的下载地址
     */
    Result upload(List<MultipartFile> files, String fileUploadPath, String fileDownloadPath);

    /**
     * 下载图片
     *
     * @param fileUuid       图片的uuid
     * @param fileUploadPath 文件上传位置
     * @param response       响应流
     */
    void download(String fileUuid, String fileUploadPath, HttpServletResponse response) throws IOException;
    void downloads(List<String> fileUuids, String fileUploadPath, HttpServletResponse response) throws IOException;

    List<String> delete(List<String> fileUuids,String fileUploadPath,String fileSavePath);
}
